package com.tanhua.manage.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.manage.domain.AnalysisByDay;
import com.tanhua.manage.vo.Title;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AnalysisMapper extends BaseMapper<AnalysisByDay> {

    @Select("SELECT SUM(`num_active`) FROM `tb_analysis_by_day` a WHERE record_date BETWEEN  #{startDate} AND #{endDate}")
    long findNumActiveByDate(@Param("startDate") String startDate,@Param("endDate")  String endDate);
    @Select("select date_format(record_date , '%Y-%m-%d') title , ${state} amount from tb_analysis_by_day where record_date between #{startTime} and #{endTime}")
    List<Title> find(@Param("state") String state, @Param("startTime") String startTime, @Param("endTime") String endTime);
}
